package com.miya.archetype.integration;

import com.alipay.sofa.runtime.api.annotation.SofaReference;
import com.alipay.sofa.runtime.api.annotation.SofaReferenceBinding;
import com.miya.archetype.common.facade.TradeXmlFacade;
import com.miya.archetype.common.facade.response.TradeResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class TradeFacadeConsumer {

    @SofaReference(interfaceType = TradeXmlFacade.class, binding = @SofaReferenceBinding(bindingType = "bolt"))
    private TradeXmlFacade tradeXmlFacadeImpl;

    Logger logger = LoggerFactory.getLogger(TradeFacadeConsumer.class);

    public void init() {
        logger.info("zeng result: " + tradeXmlFacadeImpl.getById(1));
    }

    public TradeResponse getTradeById(long id) {
        logger.warn("test service-integration... ");
        logger.error("test service-integration... ");
        return tradeXmlFacadeImpl.getById(id);
    }
}
